<template>
  <div>
      <div id="container"></div>
      <modal :visible="visible">
          <ul>
              <li v-for="item in list" :key="item.id" @click="choose(item)"> {{item.businessArea}}--{{item.address}}</li>
          </ul>
      </modal>
  </div>
</template>

<script>
import {positionPicker} from '@/utils/map';
import Modal from '@/components/modal';

export default {
    async mounted(){
        let result = await positionPicker();
        console.log(result);
        this.list = result.regeocode.pois;
        this.visible = true;
    },
    components:{
        Modal
    },
    data(){
        return {
            list:[],
            visible:false
        }
    },
    methods:{
        choose(){
            this.visible = false;
        }
    }
}
</script>

<style lang="scss" scoped>
    #container{
        width:100%;
        height: 200px;
    }
</style>